package com.kly.sc.api.application.vo;

import com.kly.user.enums.ConversationType;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class ChatDataDto {

    /**
     * 消息接收人
     */
    private String toUserCode;

    /**
     * 发送的消息数量
     */
    private Integer hasSendMsgNum;

    /**
     * @see com.kly.user.enums.ConversationType
     */
    private ConversationType conversationType;

    public ConversationType getConversationType() {
        if(hasSendMsgNum > ConversationType.DEEP_CONVERSATIONS.getSize()){
            return ConversationType.DEEP_CONVERSATIONS;
        }

        if(hasSendMsgNum > ConversationType.EFFECTIVE_CONVERSATIONS.getSize()){
            return ConversationType.EFFECTIVE_CONVERSATIONS;
        }

        if(hasSendMsgNum > ConversationType.FIRST_CONVERSATION.getSize()){
            return ConversationType.FIRST_CONVERSATION;
        }

        return ConversationType.HUNDRED_CONVERSTIONS;
    }
}
